package cn.wolfcode.trip.base.service.impl;


import cn.wolfcode.trip.base.domain.AuthorTravelUser;
import cn.wolfcode.trip.base.domain.DailyLike;
import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.mapper.AuthorTravelUserMapper;
import cn.wolfcode.trip.base.mapper.DailyLikeMapper;
import cn.wolfcode.trip.base.mapper.UserMapper;
import cn.wolfcode.trip.base.query.CollectQueryObject;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.service.IMyCollectService;
import cn.wolfcode.trip.base.service.IUserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class MyCollectServiceImpl implements IMyCollectService {
    @Autowired
    private AuthorTravelUserMapper atuMappler;
    @Autowired
    private DailyLikeMapper dlMapper;


    @Override
    public PageInfo query(CollectQueryObject qo) {

        if(qo.getType()==1){
            PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
            List<AuthorTravelUser> atus = atuMappler.queryForList(qo);
            return new PageInfo<AuthorTravelUser>(atus);
        }

         PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
         List<DailyLike> dls=dlMapper.queryForList(qo);
            return new PageInfo<DailyLike>(dls);
    }
}

